const { tool,time,api } = getApp();
Page({

    data: {
        team: {},   // 小组信息
        type: 0,    // 小组类型 0-初始状态 1-我创建的 2-我加入的 3-没有小组
    },

    // 页面加载
    onShow(options) {
        tool.getUserInfo().then(info => {
            let { open_id,team_id } = info;
            if (team_id) {
                tool.getTeamInfo(team_id).then(team => {
                    let { leader_id } = team;
                    let type = leader_id === open_id ? 1 : 2;
                    this.setData({ team,type });
                })
            } else this.setData({ type: 3 });
        })
    },
    
})